//
//  tableView.m
//  MyProj...ect
//
//  Created by dllo on 15/10/31.
//  Copyright (c) 2015年 蓝鸥0825. All rights reserved.
//

#import "tableView.h"
#import "myCell.h"
#import "CollectionFirstView.h"
#import "WHZAfnetWorking.h"
#import "UIImageView+WebCache.h"



@implementation tableView

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    if (self) {
        [self create];
    }
    return self;
}

- (void)create{
    
    self.tableView = [[UITableView alloc] initWithFrame:self.frame style:UITableViewStylePlain];
    [self addSubview: self.tableView];
    [_tableView release];
    self.tableView.rowHeight = self.frame.size.height / 2;
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    self.tableView.separatorStyle = UITableViewCellSeparatorStyleSingleLineEtched;
    
    
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
    static NSString *reuse = @"reuse";
    myCell *cell = [tableView dequeueReusableCellWithIdentifier:reuse];
    if (!cell) {
        cell = [[[myCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:reuse]autorelease];
    }
    
    cell.backgroundColor = [UIColor colorWithWhite:0.3 alpha:0.1];
    cell.model = self.array[indexPath.row];
    return cell;
    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    
//    TabelViewController *tabel = [[TabelViewController alloc] init];
//    [self.VC.navigationController pushViewController:tabel animated:YES];

}



@end
